import { h } from '@logicflow/core';
import { BaseOutModel, BaseOutView } from '../base/BaseOutNode';

class WaitModel extends BaseOutModel {
  initNodeData(data: any): void {
    super.initNodeData(data);
    this.text.value = 'Wait';
  }
}

class WaitView extends BaseOutView {
  getIcon() {
    const { x, y } = this.props.model;
    const width = 30;
    const height = 40;
    return h('image', {
      width,
      height,
      x: x - width / 2,
      y: y - height / 2,
      href: '',
    });
  }
}

export default {
  type: 'Wait',
  view: WaitView,
  model: WaitModel,
};
